import request from '@/utils/request'

// 查询项目报表列表
export function listReport(query) {
  return request({
    url: '/project/report/list',
    method: 'get',
    params: query
  })
}

// 查询项目报表详细
export function getReport(reportId) {
  return request({
    url: '/project/report/' + reportId,
    method: 'get'
  })
}

// 新增项目报表
export function addReport(data) {
  return request({
    url: '/project/report',
    method: 'post',
    data: data
  })
}

// 修改项目报表
export function updateReport(data) {
  return request({
    url: '/project/report',
    method: 'put',
    data: data
  })
}

// 删除项目报表
export function delReport(reportId) {
  return request({
    url: '/project/report/' + reportId,
    method: 'delete'
  })
}

// 查询角色已授权报表列表
export function allocatedRoleReportList(query) {
  return request({
    url: '/project/report/authReport/allocatedRoleReportList',
    method: 'get',
    params: query
  })
}

// 查询用户已授权报表列表
export function allocatedUserReportList(query) {
  return request({
    url: '/project/report/authReport/allocatedUserReportList',
    method: 'get',
    params: query
  })
}

// 查询角色未授权报表列表
export function unallocatedRoleReportList(query) {
  return request({
    url: '/project/report/authReport/unallocatedRoleReportList',
    method: 'get',
    params: query
  })
}

// 查询用户未授权报表列表
export function unallocatedUserReportList(query) {
  return request({
    url: '/project/report/authReport/unallocatedUserReportList',
    method: 'get',
    params: query
  })
}

// 授权角色报表选择
export function authRoleReport(data) {
  return request({
    url: '/project/report/authReport/authRoleReport',
    method: 'put',
    params: data
  })
}

// 授权用户报表选择
export function authUserReport(data) {
  return request({
    url: '/project/report/authReport/authUserReport',
    method: 'put',
    params: data
  })
}

// 取消角色报表授权
export function authRoleReportCancel(data) {
  return request({
    url: '/project/report/authReport/authRoleReportCancel',
    method: 'put',
    data: data
  })
}

// 取消用户报表授权
export function authUserReportCancel(data) {
  return request({
    url: '/project/report/authReport/authUserReportCancel',
    method: 'put',
    data: data
  })
}

// 批量取消角色报表授权
export function authRoleReportCancelAll(data) {
  return request({
    url: '/project/report/authReport/authRoleReportCancelAll',
    method: 'put',
    params: data
  })
}

// 批量取消用户报表授权
export function authUserReportCancelAll(data) {
  return request({
    url: '/project/report/authReport/authUserReportCancelAll',
    method: 'put',
    params: data
  })
}
